unit Unit_Message;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls;

type
  Tfrm_Message = class(TForm)
    GroupBox1: TGroupBox;
    txtArea: TMemo;
    GroupBox2: TGroupBox;
    btnSend: TSpeedButton;
    edtMessage: TEdit;
    procedure FormResize(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure edtMessageKeyPress(Sender: TObject; var Key: Char);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frm_Message: Tfrm_Message;

implementation

uses Unit_DM;

{$R *.dfm}

procedure Tfrm_Message.FormResize(Sender: TObject);
begin
  btnSend.Left:=edtMessage.Left+edtMessage.Width+6;
end;

procedure Tfrm_Message.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Self.Visible:=False;
  abort;
end;

procedure Tfrm_Message.edtMessageKeyPress(Sender: TObject; var Key: Char);
begin
  if Key=#13 then
    btnSend.Click;
end;

procedure Tfrm_Message.FormShow(Sender: TObject);
begin
  edtMessage.SetFocus;
end;

end.
